<?php
class SiteController extends Controller {
 
	public function actionIndex() {
		$this->redirect(Yii::app()->createurl('topic'));
		$this->render('index', array(
			
		));
	}
	
    public function actionMaintenance() {
        if (!$this->maintenanceMode) {
            HttpStatus::code(404);
        }
        $this->render($this->language . '/maintenance');
    }

    /**
     * This is the action to handle external exceptions.
     */
    public function actionError() {
        if ($error = Yii::app()->errorHandler->error) {
            if (Yii::app()->request->isAjaxRequest)
                echo $error['message'];
            else {
                $this->pageTitle=Lang::t('site.error.page.breadcrumbs');
                $this->breadcrumbs = array(Lang::t('site.error.page.breadcrumbs'));
                $this->render('error', $error);
            }
        }//end if
    }

    public function actionResponse() {
        
        $params=Yii::app()->response->params;
        $page=Yii::app()->response->getPage();
        $this->render(implode('/', array($this->language,'response',$page)), $params);
    }

    /**
     * static pages
     */
    public function actionAbout() {
        $this->render($this->language . '/about');
    }
    
    public function actionPrivacy(){
        $this->render($this->language . '/privacy');
    }
    
    public function actionDisclaimers(){
        $this->render($this->language . '/disclaimers');
    }
    
    public function actionTermsofuse(){
        $this->render($this->language . '/termsOfUse');
    }
    
}//end class